package com.example.joke.test

import android.text.Editable
import android.text.TextWatcher
import com.example.joke.databinding.ActivityTestFlexboxLayoutBinding
import com.example.joke.frame.BaseSkinActivity
//import com.google.android.flexbox.FlexDirection
//import com.google.android.flexbox.FlexWrap

class TestFlexboxLayoutActivity : BaseSkinActivity<ActivityTestFlexboxLayoutBinding>() {

    private var num: Int = 0

    override fun setListener() {

//        binding.et.addTextChangedListener(object : TextWatcher {
//            override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {
//            }
//
//            override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {
//            }
//
//            override fun afterTextChanged(s: Editable?) {
//                val inputStr = s.toString()
//                if (!inputStr.isNullOrEmpty()) {
//                    initFlex(inputStr.toInt())
//                }
//            }
//
//        })
    }

    private fun initFlex(num: Int) {
        binding.apply {
//            flex.removeAllViews()
//            when (num) {
//                1,2,3,4 -> {
//                    flex.flexWrap = FlexWrap.WRAP
//
//                }
//                else -> {
//                    flex.flexDirection = FlexDirection.COLUMN
//                }
//            }
        }

    }

    override fun initData() {
    }

    override fun initTitle() {
    }

    override fun getBinding1(): ActivityTestFlexboxLayoutBinding {
        return ActivityTestFlexboxLayoutBinding.inflate(layoutInflater)
    }
}